package com.atguigu.gmall.pms.vo;

import com.atguigu.gmall.pms.entity.ProductAttrValueEntity;
import org.apache.commons.lang3.StringUtils;

import java.util.List;

public class ProductAttrValueVO extends ProductAttrValueEntity {
    //接收参数valueSelected，找的是setValueSelected方法
    public void setValueSelected(List<Object> valueSelected) {
        //如果接受的集合为空，则不设置
        if (valueSelected.isEmpty()) {
            return;
        }
        //将集合转为String，用“,”拼接
        this.setAttrValue(StringUtils.join(valueSelected,","));
    }
}
